package material.command.undo;

import material.command.receiver_命令接收者.Light;

public class LightOnCommand implements Command {
    Light light;

    public LightOnCommand(Light light) {
        this.light = light;
    }

    @Override
    public void execute() {
        light.on();
    }

    /**
     * execute执行的是打开灯，所以undo应该执行的是关闭灯
     */
    @Override
    public void undo() {
        light.off();
    }
}
